﻿@model Unijovem.UI.Models.CampoPerfilModel

@{
    ViewBag.Title = "Manter";
}

<h2>Manter</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>CampoPerfilModel</legend>
        
        @if(Model != null && Model.Id != 0)
        {
            @Html.HiddenFor(model => model.Id)
        }

        <div class="editor-label">
            @Html.LabelFor(model => model.Nome)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nome)
            @Html.ValidationMessageFor(model => model.Nome)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Descricao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descricao)
            @Html.ValidationMessageFor(model => model.Descricao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdGrupo)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.IdGrupo, (SelectList)ViewBag.Grupos)
            @Html.ValidationMessageFor(model => model.IdGrupo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Tipo)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.IdTipo, (SelectList)ViewBag.TiposDados)
            @Html.ValidationMessageFor(model => model.Tipo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TipoControle)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.IdTipoControle, (SelectList)ViewBag.TiposControles)
            @Html.ValidationMessageFor(model => model.TipoControle)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Obrigatorio)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Obrigatorio)
            @Html.ValidationMessageFor(model => model.Obrigatorio)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ExpressaoRegular)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ExpressaoRegular)
            @Html.ValidationMessageFor(model => model.ExpressaoRegular)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.MaxLenght)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MaxLenght)
            @Html.ValidationMessageFor(model => model.MaxLenght)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

